{extend name="user/index" /}

{block name="title"}
<title>[ 修改管理员密码 ]</title>
{/block}

{block name="css"}

{/block}

{block name="main"}

<div class="container mt50">
    <div class="row">
        <h1>
            管理员： {$row['name']}
            <span class="label label-primary label-outline">{$row['id']}</span>
        </h1>
        <hr>
        <br>
        <div class="col-md-5">
            <h2>修改管理员密码</h2>
            <hr>
            <form action="{:url('index/user/adminpass')}" method="post" name="adminpass" onsubmit="return checkePass()">
                <input type="hidden" name="id" value="{:session('admin.id')}">
                <div class="input-group col-md-12">
                    <input class="form-control input-lg" style="font-size: 25px" type="text" name="pass"
                           placeholder="管理员密码会立即生效!">
                    <span class="input-group-btn">
                        <button class="btn btn-lg btn-primary" type="submit">立即修改</button>
                    </span>
                </div>
                <div class="help-block text-danger">密码不得为空！修改成功后，请重新用新密码登录</div>
            </form>
        </div>
    </div>
</div>
{/block}

{block name="js"}
<script>
    function checkePass() {
        if (document.adminpass.pass.value === '') {
            alert('密码不得为空!');
            return false;
        }
        if (document.adminpass.pass.value.length < 6) {
            alert('密码不得少于6位!');
            return false;
        }
        return true;
    }

</script>
{/block}
